package com.wizard.moremall.common.service.impl;

import com.wizard.moremall.common.entity.Product;
import com.wizard.moremall.common.mapper.ProductMapper;
import com.wizard.moremall.common.service.IProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wizard.moremall.common.vo.ProductVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-01-18
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {

    //二级分类跳转商品页面
    @Override
    public List<ProductVO> getByCategoryId(Integer categoryId) {
        return baseMapper.getByCategoryId(categoryId);
    }

    //根据具体id跳转商品详情
    @Override
    public ProductVO getByProductId(Integer productId) {
        return baseMapper.getByProductId(productId);
    }
}
